//
//  LeadPageViewController.m
//  HomeFurnishing
//
//  Created by dllo on 16/4/9.
//  Copyright © 2016年 YMing. All rights reserved.
//

#import "LeadPageViewController.h"

@interface LeadPageViewController ()
@property(nonatomic, assign)BOOL isChange;
@end

@implementation LeadPageViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view.
    self.view.backgroundColor = [UIColor whiteColor];
    
    UIScrollView *scr = [[UIScrollView alloc] initWithFrame:self.view.frame];
    scr.contentSize = CGSizeMake(self.view.bounds.size.width * 3, self.view.bounds.size.height);
    scr.alwaysBounceHorizontal = YES;
    scr.pagingEnabled = YES;
    
    for (NSInteger i = 0; i<3; i++) {
        UIImageView *imgView = [[UIImageView alloc] initWithFrame:CGRectMake(SCREEN_WIDTH*i, 0, SCREEN_WIDTH, SCREEN_HEIGHT)];
        NSString *str = [NSString stringWithFormat:@"img_introview_960_%ld",(i+1)];
        imgView.image = [UIImage imageNamed:str];
        [scr addSubview:imgView];
        [imgView release];
    }
    [self.view addSubview:scr];
    [scr release];
    
    UIButton *btn = [UIButton buttonWithType:UIButtonTypeSystem];
    btn.frame = CGRectMake( SCREEN_WIDTH*2 , SCREEN_HEIGHT - 130, SCREEN_WIDTH, 60);
    //btn.backgroundColor = [UIColor yellowColor];
    [scr addSubview:btn];
    [btn addTarget:self action:@selector(goaa) forControlEvents:UIControlEventTouchUpInside];
    
}
-(void)goaa
{
    self.secBlock(!_isChange);
    
}
- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
